package com.tanhua.manager.controller;

import com.tanhua.manager.service.SummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dashboard")
public class SummaryController {
    @Autowired
    private SummaryService summaryService;
    /**
     * GET/dashboard/summary
     * 概述信息
     */
    @GetMapping("/summary")
    public ResponseEntity summary(){
        return summaryService.summary();
    }

    /**
     * GET/dashboard/users
     * 新增、活跃用户、次日留存率  折线图
     */
    @GetMapping("/users")
    public ResponseEntity usersChartData(Long sd, Long ed, Integer type){
        return summaryService.usersChartData(sd,ed,type);
    }
}
